class My implements Runnable{

    public void run(){
        while(true){
            System.out.println(Thread.currentThread().getName());
        }
    }
    
}

public class SetDaemon{

    public static void main(String[] args){

        My m = new My();
        Thread t = new Thread(m, "Thead 007");
        // use setDaemon
        t.setDaemon(true);
        t.start();

        try{
            Thread.sleep(200);            
        }catch(Exception e){
            e.printStackTrace();
        }

        System.out.println("Bye!");

    }

}